﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<Sys.WebRes.Publish.Areas.Admin.Models.AttachmentModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	编辑附件
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript" language="javascript">
    function uploadFiles() {
        //window.frameElement.okHandler();
    }
    function cancel() {
        window.frameElement.cancelHandler();
    }
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="BodyContent" runat="server">
    <% using (Html.BeginForm(null, null, FormMethod.Post, new {enctype="multipart/form-data"})) {%>
        <%= Html.ValidationSummary(true) %>
        <div class="demo-info">
		    <div class="demo-tip icon-tip"></div>
		    <div>
                <ul>
                    <li>1.上传路径为空，表示重新按新建规则生成文件。</li>
                    <li>2.指定上传路径，有可能会覆盖已上传文件。（编辑情况以外，慎用）</li>
                </ul>
            </div>
	    </div>
        <fieldset>
            <legend>附件数据项</legend>
            <%= Html.HiddenFor(model => model.ID)%>
            <table style="width:100%; height:100%;">
                <tr>
                    <td class="editor-label" style="width:60px;">
                        <label for="file1">上传路径</label>
                    </td>
                    <td class="editor-field">
                        <%= Html.TextBoxFor(m=>m.FilePath, new { @size = 50, @readonly = true})%>
                        <a id="clearLink" href="javascript:void(0)" onclick="$('#FilePath').val('');">清空</a><br />
                        <label for="clearLink">※清空表示重新按新建规则生成文件</label>
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        <label for="file1">文件</label>
                    </td>
                    <td class="editor-field">
                        <img src="<%=Url.Action("Thumb", "Attachment", new { Area="", path=Model.FilePath}) %>" width="100" alt="预览"/>
                        <input type="file" name="file1" id="file1" size="50"/>
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        <label for="Title">标题</label>
                    </td>
                    <td class="editor-field">
                        <%= Html.TextBoxFor(model => model.Title, new { @size=30})%>
                        <%= Html.ValidationMessageFor(model => model.Title)%>
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        <label for="Summary">概要</label>
                    </td>
                    <td class="editor-field">
                        <%= Html.TextAreaFor(model => model.Summary, new { rows = 5, cols = 50 })%>
                        <%= Html.ValidationMessageFor(model => model.Summary)%>
                    </td>
                </tr>
                <tr>
                    <td class="editor-label">
                        <label for="CustomType">自定义分类</label>
                    </td>
                    <td class="editor-field">
                        <%= Html.TextBoxFor(model => model.CustomType, new { @size=30})%>
                        <%= Html.ValidationMessageFor(model => model.CustomType)%>
                    </td>
                </tr>
            </table>
            <div class="operDiv" style="text-align:center; height:40px;"><br />
                <a class="easyui-linkbutton" href="javascript:document.forms[0].submit();" onclick="">上传</a>
                <a class="easyui-linkbutton" href="javascript:void(0)" onclick="cancel()">取消</a>
            </div>
        </fieldset>
    <%}%>
</asp:Content>